﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;

namespace czj_shop.Service
{
    public interface ICarService
    {
        /// <summary>
        /// 根据用户Id和商品Id查询购物车对象
        /// </summary>
        /// <param name="userId"></param>
        /// <param name="goodId"></param>
        /// <returns></returns>
        Car GetCar(int userId, int goodId);

        /// <summary>
        /// 更新购物车商品数量
        /// </summary>
        /// <param name="car"></param>
        /// <param name="count"></param>
        /// <returns></returns>
        bool UpdateCarCount(Car car, int count);

        /// <summary>
        /// 根据商品Id和用户Id添加购物车记录
        /// </summary>
        /// <param name="goodId"></param>
        /// <param name="uId"></param>
        /// <returns></returns>
        bool AddCar(int goodId, int userId);

        /// <summary>
        /// 删除购物车
        /// </summary>
        /// <returns></returns>
        bool DeleteCar(Car car);
    }
}
